// components/homeList/homeList.js
Component({
	/**
	 * 组件的属性列表
	 */
	properties: {
		title: {
			type: String,
			value: '',
		},
		list: {
			type: Array,
			value: [],
		},
	},

	/**
	 * 组件的初始数据
	 */
	data: {

	},

	/**
	 * 组件的方法列表
	 */
	methods: {
		goToDetail(e) {
			let id = e.currentTarget.dataset.id
			let index = e.currentTarget.dataset.index
			if (this.data.title == '热门歌手') {
				wx.navigateTo({
					url: `../../pages/singerSongs/singerSongs?id=${id}`,
				})
			} else {
				wx.setStorageSync('songs', JSON.stringify(this.properties.list))
				wx.navigateTo({
					url: `../../pages/detail/detail?id=${id}&index=${index}`,
				})
			}
		},
	}
})
